package br.inf.solutions.apresentacoes.ssp.control.validator;

import java.util.Map;

import br.com.vexillum.util.Return;
import br.inf.solutions.apresentacoes.ssp.model.bulletin.items.FunctionPerson;

public class FunctionPersonValidator extends BaseValidator {

	public FunctionPersonValidator(Map<String, Object> mapData) {
		super(mapData);
	}

	public Return validateAssignFunction() {
		Return ret = new Return(true);
		FunctionPerson thisFunctionPerson = (FunctionPerson) mapData.get("thisFunctionPerson");
		if (thisFunctionPerson.getBeginDate() == null)
			ret.concat(creatReturn("beginDate",	getValidationMessage("beginDate", "save", false)));
		if (thisFunctionPerson.getHierarchyStructEntity() == null) {
			ret.concat(creatReturn("hierarchyStructEntity",getValidationMessage("hierarchyStructEntity", "save", false)));
		}
		return ret;
	}
}
